{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# 💡 What's new in txtai 6.0\n",
        "\n",
        "txtai 6.0 brings a number of major feature enhancements. Highlights include:\n",
        "\n",
        "- Embeddings\n",
        "  - Sparse/keyword indexes\n",
        "  - Hybrid search\n",
        "  - Subindexes\n",
        "  - Streamlined methods\n",
        "\n",
        "- Large Language Models (LLMs)\n",
        "  - Automatically instantiate the best available underlying model\n",
        "  - Pass through parameters enabling immediate support as features are released upstream\n",
        "\n",
        "These are just the big, high level changes. There are also many improvements and bug fixes.\n",
        "\n",
        "This notebook will cover all the changes with examples.\n",
        "\n",
        "**Standard upgrade disclaimer below**\n",
        "\n",
        "6.0 is one of the largest, if not largest releases to date! While almost everything is backwards compatible, it's prudent to backup production indexes before upgrading and test before deploying."
      ],
      "metadata": {
        "id": "e3wdiK5fGUoZ"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Install dependencies\n",
        "\n",
        "Install `txtai` and all dependencies."
      ],
      "metadata": {
        "id": "p8BbfjrhH-V2"
      }
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "-OXsTQgaGQPM"
      },
      "outputs": [],
      "source": [
        "%%capture\n",
        "!pip install git+https://github.com/neuml/txtai#egg=txtai[graph] datasets"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Sparse indexes\n",
        "\n",
        "While dense vector indexes are by far the best option for semantic search systems, sparse keyword indexes can still add value. There may be cases where finding an exact match is important or we just want a fast index to quickly do an initial scan of the dataset.\n",
        "\n",
        "Unfortunately, there aren't a ton of great options for a local Python-based keyword index library. Most of the options available don't scale and are highly inefficient, designed only for simple situations. With 6.0, txtai has added a performant sparse index component with speed and accuracy on par with Apache Lucene. A future article will discuss the engineering behind this.\n",
        "\n",
        "Let's take a look. We'll use a [prompt dataset on the Hugging Face Hub](https://huggingface.co/datasets/fka/awesome-chatgpt-prompts) for all examples."
      ],
      "metadata": {
        "id": "n4EXrtcYIIYE"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from datasets import load_dataset\n",
        "\n",
        "import txtai\n",
        "\n",
        "# Load dataset\n",
        "ds = load_dataset(\"fka/awesome-chatgpt-prompts\", split=\"train\")\n",
        "\n",
        "def stream():\n",
        "  for row in ds:\n",
        "    yield f\"{row['act']} {row['prompt']}\"\n",
        "\n",
        "# Build sparse keyword index\n",
        "embeddings = txtai.Embeddings(keyword=True, content=True)\n",
        "embeddings.index(stream())\n",
        "\n",
        "embeddings.search(\"Linux terminal\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "hzPD8_cQJNtN",
        "outputId": "22059d6e-9022-4fa9-8f54-bd2609508f1e"
      },
      "execution_count": 34,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.5932681465337526}]"
            ]
          },
          "metadata": {},
          "execution_count": 34
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "And there it is, a keyword index!\n",
        "\n",
        "Couple things to unpack here. First, for those familar with txtai, notice that only a text field was yielded in the `stream` method. With 6.0, when ids aren't provided, they are automatically generated.\n",
        "\n",
        "Next notice the score. Those familar with keyword scores (TF-IDF, BM25) will notice that the score seems low. That is because with a keyword index, the default score is normalized between 0 and 1.\n",
        "\n",
        "More on these items later."
      ],
      "metadata": {
        "id": "caDteWUVK5jI"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Hybrid Search\n",
        "\n",
        "The addition of sparse indexes enables hybrid search. Hybrid search combines the results from sparse and dense vector indexes for the best of both worlds."
      ],
      "metadata": {
        "id": "m7lGqfvDMPQA"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Build hybrid index\n",
        "embeddings = txtai.Embeddings(hybrid=True, content=True)\n",
        "embeddings.index(stream())\n",
        "\n",
        "embeddings.search(\"Linux terminal\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "cRXnGeqJMWql",
        "outputId": "e4c38ad5-59c0-4fd1-ec1d-d64372b19902"
      },
      "execution_count": 19,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.6078515601252442}]"
            ]
          },
          "metadata": {},
          "execution_count": 19
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Simple change with big impacts. This new index now has both a sparse and dense (using default `sentence-transformers/all-MiniLM-L6-v2` model) index. These scores are combined into a single score as seen above.\n",
        "\n",
        "The scoring weights (also known as alpha) control the weighting between the sparse and dense index."
      ],
      "metadata": {
        "id": "6bHDxRm5NXI7"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "embeddings.search(\"Linux terminal\", 1, weights=1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "RWFnXVTRNPHC",
        "outputId": "b644cbb0-e4d5-41d6-ea72-6a139a160f0c"
      },
      "execution_count": 20,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.6224349737167358}]"
            ]
          },
          "metadata": {},
          "execution_count": 20
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "embeddings.search(\"Linux terminal\", 1, weights=0)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "EYcv21vENRtp",
        "outputId": "25b7516f-e23e-4f67-bcdc-c1ff3e157009"
      },
      "execution_count": 21,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.5932681465337526}]"
            ]
          },
          "metadata": {},
          "execution_count": 21
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "A weight of 1 only uses the dense index and 0 only uses the sparse index. Notice the score with `weight = 0` is the same as the sparse index query earlier."
      ],
      "metadata": {
        "id": "cVwf7KeqNydT"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Subindexes\n",
        "\n",
        "While sparse and hybrid indexes are great new features, the prize of this release is the addition of subindexes. Subindexes will add a host of new ways to build txtai embeddings instances. Let's give a brief intro here."
      ],
      "metadata": {
        "id": "4gUIB_vIODSg"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Build index with subindexes\n",
        "embeddings = txtai.Embeddings(\n",
        "    content=True,\n",
        "    defaults=False,\n",
        "    indexes={\n",
        "        \"sparse\": {\n",
        "            \"keyword\": True\n",
        "        },\n",
        "        \"dense\":{\n",
        "\n",
        "        }\n",
        "    }\n",
        ")\n",
        "embeddings.index(stream())\n",
        "\n",
        "# Run search\n",
        "embeddings.search(\"select id, text, score from txtai where similar('Linux terminal', 'sparse') and similar('Linux terminal', 'dense')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "9nkna32MObBi",
        "outputId": "3f57c63e-8b4b-4d75-f4db-3455ed667ec2"
      },
      "execution_count": 22,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.6078515601252442}]"
            ]
          },
          "metadata": {},
          "execution_count": 22
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "embeddings.search(\"select id, text, score from txtai where similar('Linux terminal', 'dense')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "cPysPMHRR2IS",
        "outputId": "77b19baa-0643-4958-dd59-363ce05017a8"
      },
      "execution_count": 23,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.6224349737167358}]"
            ]
          },
          "metadata": {},
          "execution_count": 23
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "embeddings.search(\"select id, text, score from txtai where similar('Linux terminal', 'sparse')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "KYEFkDRDSJ4J",
        "outputId": "bcb2460d-9cdd-4808-f861-71405044849d"
      },
      "execution_count": 24,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'text': 'Linux Terminal I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.5932681465337526}]"
            ]
          },
          "metadata": {},
          "execution_count": 24
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Notice how the scores are the same as above. The three searches above run a hybrid search, dense and sparse search. This time though it's using subindexes. The top-level Embeddings only has an associated database.\n",
        "\n",
        "Each of the sections in the `indexes` is a full embeddings index supporting all available options. For example, let's add a graph subindex."
      ],
      "metadata": {
        "id": "hJGAjnpbSTRu"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Build index with graph subindex\n",
        "embeddings = txtai.Embeddings(\n",
        "    content=True,\n",
        "    defaults=False,\n",
        "    functions=[\n",
        "        {\"name\": \"graph\", \"function\": \"indexes.act.graph.attribute\"}\n",
        "    ],\n",
        "    expressions=[\n",
        "        {\"name\": \"topic\", \"expression\": \"graph(indexid, 'topic')\"},\n",
        "    ],\n",
        "    indexes={\n",
        "        \"act\": {\n",
        "            \"keyword\": True,\n",
        "            \"columns\": {\n",
        "                \"text\": \"act\"\n",
        "            },\n",
        "            \"graph\": {\n",
        "                \"topics\": {}\n",
        "            }\n",
        "        },\n",
        "        \"prompt\":{\n",
        "            \"columns\": {\n",
        "                \"text\": \"prompt\"\n",
        "            }\n",
        "        }\n",
        "    }\n",
        ")\n",
        "embeddings.index(ds)\n",
        "\n",
        "# Run search\n",
        "embeddings.search(\"select id, act, prompt, score, topic from txtai where similar('Linux terminal')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "D35uFFnESqP3",
        "outputId": "d5ee3775-d488-4e46-a44b-3ae4a12a6c1f"
      },
      "execution_count": 25,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'act': 'Linux Terminal',\n",
              "  'prompt': 'I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.6382951796072414,\n",
              "  'topic': 'terminal_linux_sql'}]"
            ]
          },
          "metadata": {},
          "execution_count": 25
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Notice the new `topic` field added to this query. That comes from the graph index, which runs topic modeling. Also notice that two indexes for two different columns are added.\n",
        "\n",
        "Note that graph indexes are different in that they depend on a sparse or dense index being available. That is how the graph is automatically constructed. For good measure, let's add the graph to a dense index."
      ],
      "metadata": {
        "id": "t_OIM6tPUnC_"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Build index with graph subindex\n",
        "embeddings = txtai.Embeddings(\n",
        "    content=True,\n",
        "    defaults=False,\n",
        "    functions=[\n",
        "        {\"name\": \"graph\", \"function\": \"indexes.act.graph.attribute\"}\n",
        "    ],\n",
        "    expressions=[\n",
        "        {\"name\": \"topic\", \"expression\": \"graph(indexid, 'topic')\"},\n",
        "    ],\n",
        "    indexes={\n",
        "        \"act\": {\n",
        "            \"path\": \"intfloat/e5-small-v2\",\n",
        "            \"columns\": {\n",
        "                \"text\": \"act\"\n",
        "            },\n",
        "            \"graph\": {\n",
        "                \"topics\": {}\n",
        "            }\n",
        "        },\n",
        "        \"prompt\":{\n",
        "            \"path\": \"sentence-transformers/all-MiniLM-L6-v2\",\n",
        "            \"columns\": {\n",
        "                \"text\": \"prompt\"\n",
        "            }\n",
        "        }\n",
        "    }\n",
        ")\n",
        "embeddings.index(ds)\n",
        "\n",
        "# Run search\n",
        "embeddings.search(\"select id, act, prompt, score, topic from txtai where similar('Linux terminal')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Me8zJse7WbdM",
        "outputId": "14433e6b-9eed-4cd2-e590-4c9c03be390a"
      },
      "execution_count": 26,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'act': 'Linux Terminal',\n",
              "  'prompt': 'I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 1.0,\n",
              "  'topic': 'linux_terminal'}]"
            ]
          },
          "metadata": {},
          "execution_count": 26
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Almost the same as above except the topic is different. This is due to the grouping of the vector index. Notice how the `act` column and `prompt` column are both vector indexes but specify different vector models. This opens up another possibility of weighting not only sparse vs vector but different vector models."
      ],
      "metadata": {
        "id": "yKHVU_r4W9HD"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "embeddings.search(\"select id, act, prompt, score from txtai where similar('Linux terminal', 'act') and similar('Linux terminal', 'prompt')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "2Yqky3ntYKUJ",
        "outputId": "02672b7b-9e28-4d6d-dd74-acaf475ddf72"
      },
      "execution_count": 27,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'act': 'Linux Terminal',\n",
              "  'prompt': 'I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'score': 0.7881423830986023}]"
            ]
          },
          "metadata": {},
          "execution_count": 27
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "As always, everything discussed so far is also supported with txtai application instances."
      ],
      "metadata": {
        "id": "obZhFSIKZT4u"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Build index with graph subindex\n",
        "app = txtai.Application(\"\"\"\n",
        "writable: True\n",
        "embeddings:\n",
        "  content: True\n",
        "  defaults: False\n",
        "  functions:\n",
        "    - name: graph\n",
        "      function: indexes.act.graph.attribute\n",
        "  expressions:\n",
        "    - name: topic\n",
        "      expression: graph(indexid, 'topic')\n",
        "  indexes:\n",
        "    act:\n",
        "      path: intfloat/e5-small-v2\n",
        "      columns:\n",
        "        text: act\n",
        "      graph:\n",
        "        topics:\n",
        "    prompt:\n",
        "      path: sentence-transformers/all-MiniLM-L6-v2\n",
        "      columns:\n",
        "        text: prompt\n",
        "\"\"\")\n",
        "\n",
        "app.add(ds)\n",
        "app.index()\n",
        "\n",
        "app.search(\"select id, act, prompt, topic, score from txtai where similar('Linux terminal', 'act') and similar('Linux terminal', 'prompt')\", 1)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "3MDvZoaGZZhI",
        "outputId": "981072e4-70bf-4f2e-bc92-ee92083ec21a"
      },
      "execution_count": 28,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'id': '0',\n",
              "  'act': 'Linux Terminal',\n",
              "  'prompt': 'I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd',\n",
              "  'topic': 'linux_terminal',\n",
              "  'score': 0.7881423830986023}]"
            ]
          },
          "metadata": {},
          "execution_count": 28
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Streamlined methods\n",
        "\n",
        "Much of this has been covered already but a number of changes were added to make it easier to search and index data. The existing interfaces are all still supported, this is all about ease of use.\n",
        "\n",
        "See the code explanations below."
      ],
      "metadata": {
        "id": "WNSJ6tR1Y_KI"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Top-level import includes Application and Embeddings\n",
        "import txtai\n",
        "\n",
        "app = txtai.Application(\"\"\"writable: False\"\"\")\n",
        "embeddings = txtai.Embeddings()"
      ],
      "metadata": {
        "id": "MoW5QkxNZKBL"
      },
      "execution_count": 29,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# Ids are automatically generated when omitted\n",
        "embeddings.index([\"test\"])\n",
        "print(embeddings.search(\"test\"))\n",
        "\n",
        "# UUID ids are also supported - use any of the methods in https://docs.python.org/3/library/uuid.html\n",
        "embeddings = txtai.Embeddings(autoid=\"uuid5\")\n",
        "embeddings.index([\"test\"])\n",
        "embeddings.search(\"test\")"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "6CckssTWbD3y",
        "outputId": "e826ea96-e6aa-4902-d75d-4ed2df031a65"
      },
      "execution_count": 30,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[(0, 0.9999998807907104)]\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[('4be0643f-1d98-573b-97cd-ca98a65347dd', 0.9999998807907104)]"
            ]
          },
          "metadata": {},
          "execution_count": 30
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Large Language Models (LLMs)\n",
        "\n",
        "While the bulk of the changes in this release came with the embeddings package, LLMs also have important changes that make it easier to use."
      ],
      "metadata": {
        "id": "v_Dt9kltcRg8"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import torch\n",
        "\n",
        "from txtai.pipeline import LLM\n",
        "\n",
        "# Create model and set dtype to use 16-bit floats\n",
        "llm = LLM(\"tiiuae/falcon-rw-1b\", torch_dtype=torch.bfloat16)"
      ],
      "metadata": {
        "id": "HL1caw21cfxO"
      },
      "execution_count": 31,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "print(llm(\"Write a short list of things to do in Paris\", maxlength=55))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "G7OgcAUXg2RA",
        "outputId": "83e86070-9212-4d21-b5b1-2712389cac09"
      },
      "execution_count": 32,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            ".\n",
            "- Visit the Eiffel Tower.\n",
            "- Visit the Louvre.\n",
            "- Visit the Arc de Triomphe.\n",
            "- Visit the Notre Dame Cathedral.\n",
            "- Visit the Sacre Coeur Basilica\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "The new `LLM` pipeline automatically detects the type of model and loads it using the best available method.\n",
        "\n",
        "The pipeline framework now passes through keyword arguments to the underlying methods, which adds support for new Hugging Face features automatically as they are released."
      ],
      "metadata": {
        "id": "j06rZByEhwnO"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Wrapping up\n",
        "\n",
        "This notebook gave a quick overview of txtai 6.0. Updated documentation and more examples will be forthcoming. There is much to cover and much to build on!\n",
        "\n",
        "See the following links for more information.\n",
        "\n",
        "- [6.0 Release on GitHub](https://github.com/neuml/txtai/releases/tag/v6.0.0)\n",
        "- [Documentation site](https://neuml.github.io/txtai)"
      ],
      "metadata": {
        "id": "tvnMO1Eai6Gy"
      }
    }
  ]
}
